package person.aoao.library.service;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import person.aoao.library.entity.UserList;
import person.aoao.library.result.ResponseData;
import person.aoao.library.vo.ListData;

/**
 * 用户表(UserList)表服务接口
 *
 * @author makejava
 * @since 2023-05-05 10:15:40
 */
public interface UserListService {

    /**
     * 通过ID查询单条数据
     *
     * @param id 主键
     * @return 实例对象
     */
    UserList queryById(Integer id);

    /**
     * 分页查询
     *
     * @param userList    筛选条件
     * @param pageRequest 分页对象
     * @return 查询结果
     */
    Page<UserList> queryByPage(UserList userList, PageRequest pageRequest);

    /**
     * 新增数据
     *
     * @param userList 实例对象
     * @return 实例对象
     */
    UserList insert(UserList userList);

    /**
     * 修改数据
     *
     * @param userList 实例对象
     * @return 实例对象
     */
    UserList update(UserList userList);

    /**
     * 通过主键删除数据
     *
     * @param id 主键
     * @return 是否成功
     */
    boolean deleteById(Integer id);


    UserList reqLogin(String uid, String password);

    Integer updateReader(String uid, UserList reader);


    ListData getUesrList(String type, Integer num, Integer  page);

    ResponseData checkInfo(String type, String value);

    UserList getUserInfoByUid(String uid);

    ResponseData deleteUserInfo(Integer id);

    ListData searchUser(String replace,String type,Integer num,Integer page);

    ResponseData addAdmin(String uid, Integer roleid);

    ResponseData getUserDetail(String uid);

    ResponseData editPaawd(UserList userList);

    ResponseData getHomePage();
}
